package com.naiterui.ehp.bs.cms.modules.recommend.feign;

import com.naiterui.ehp.bp.bo.esign.EsignNoSecretBO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

/**
 * @author guoyongxiang
 * @date 2019/12/3 17:28
 * @since 1.0.0
 */
@RequestMapping("inner/pharmacist")
@FeignClient(name = "esign", url = "${ehp.domain.esign}", configuration = FeignConfiguration.class)
public interface IEsignFeignClient {

    @PostMapping("esign/ph/add")
    void signUserAdd(@RequestParam("userId") Long userId, @RequestParam("name") String name, @RequestParam("idCard") String idCard,
                     @RequestParam("phone") String phone, @RequestParam("titleId") Integer titleId,
                     @RequestParam("hospital") String hospital) throws BusinessException;

    /**
     * 实名验证-发送验证短信
     *
     * @param name
     * @param phone
     * @param idCard
     *
     * @throws BusinessException
     */
    @PostMapping("esign/realname/code")
    void realnameCode(@RequestParam("name") String name, @RequestParam("phone") String phone,
                      @RequestParam("idCard") String idCard) throws BusinessException;

    /**
     * 实名验证-校验验证码
     *
     * @param phone
     * @param code
     *
     * @return
     *
     * @throws BusinessException
     */
    @PostMapping("esign/realname/check")
    Boolean realnameCheck(@RequestParam("phone") String phone, @RequestParam("code") String code) throws BusinessException;

    /**
     * 获取免签信息
     * @param pharmacistId 药师id
     * @return
     * @throws BusinessException
     */
    @GetMapping("/getNoSecretInfo")
    EsignNoSecretBO getNoSecretInfo(@RequestParam("pharmacistId") Long pharmacistId) throws BusinessException;

}
